<template>
  <div class="bc-menu">
    <div class="menu-item">
      <span class="item blue" v-for="(item,index) in menu" :class="{'active': currentIndex==index}" :key="index" @click="selectMenu(item, index)">{{item.name}}</span>
    </div>
    <div class="menu-item-se">
      <div class="se-li" v-for="(item, index) in list" :key="index">
        <div class="title" @click="view3D">
          <span class="s-name">{{item.name}}</span>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: "headBar",
  computed: {
  },
  data () {
    return {
      currentIndex: 0,
      currentMenu: 0,
      currentPage: 1,
      pageSize: 5,
      currentActive: 0,
      cIndex: 0,
      list: [],
      vList: [],
      menu: [{
        name: '创优71条',
        path: '/installer/excellence/index'
      }]
    }
  },
  components: {
  },
  mounted () {
  },
  created () {
    this.queryBimCategory()
  },
  methods: {
    selectMenu (item, index) {
      // this.currentIndex = index
      // this.currentActive = 0
      // this.cIndex = 0
      // this.currentPage = 1
    },
    changePage (page = 0) {
      if (page) {
        if (this.currentPage < 1) {
          return false
        } else {
          this.currentPage = this.currentPage - 1
        }
      } else {
        if (this.currentPage >= Math.ceil(this.vList.length / 5)) {
          return false
        } else {
          this.currentPage = this.currentPage + 1
        }
      }
      this.cIndex = 0
      this.$router.push({ path: `/installer/bim/case?url=${this.currentList[0].down_url}` })
    },
    queryBimCategory () {
      this.$http.queryBimCategory({}).then(res => {
        this.list = res.data
        if (this.list && this.list.length && this.list[0].subCategorys && this.list[0].subCategorys.length) {
          this.$router.push({ path: `/installer/bim/3d/${this.list[0].subCategorys[0].fieldId}?name=${this.list[0].subCategorys[0].fileName}` })
        }
      })
    },
    collspaA (item, index) {
      this.currentMenu = -1
    },
    collspaR (item, index) {
      this.currentMenu = index
    },
    view3D () {
      this.$router.push({ path: `/installer/excellence/index` })
    },
    toVideo (item, i) {
      this.cIndex = i
      this.$router.push({ path: `/installer/bim/case?url=${item.down_url}` })
    }
  }
}

</script>

<style lang="scss">
</style>
